// 节流，在固定事件内执行函数
function throttle(fn, wait) {
    let now
    return function(...args) {
        const currentTime = Date.now()
        if (!now || currentTime - now > wait) {
            fn.apply(this, args)
            now = Date.now()
        }
    }
}